var xmlhttp;
function criaObjeto(){
	try{
		xmlhttp = new XMLHttpRequest();
	}catch(ee){
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(E){
				xmlhttp = false;
			}
		}
	}
}

function carregaConteudo(nomediv,pagina,debug){
	var array = new Array();
	var dados = new Array();
	criaObjeto();
	
	document.getElementById(nomediv).innerHTML = "<div style='font-family:'Trebuchet MS',Arial; font-size:10px; color:#333333;'>Carregando...</div><hr size='1' color='#cccccc'>";
	xmlhttp.open('GET', pagina, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4)
		{
		  string = xmlhttp.responseText;
		  string = string.replace(/\+/g," ");
		  string = unescape(string);
		  if(debug){alert(string);}
			//eval(string);
			document.getElementById(nomediv).innerHTML = string;
		}
	}
	xmlhttp.send(null);
}
